/*
 * @Author: wwl 2967796480@qq.com
 * @Date: 2023-08-08 08:58:00
 * @LastEditors: wwl 2967796480@qq.com
 * @LastEditTime: 2023-09-12 10:13:58
 * @FilePath: \ConstantBlueCloud_WEB_USER_DZ1 - 副本\src\api\singleParam.ts
 * @Description: 
 * 
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. 
 */
import Request from '@/libs/request'

/**web 单设备水质数据 --单参数指标详细  --图表 */
export const uSelectSingleParamDataStatistic = (data: {
  devId: string | number
  paramName: string
  startTime: string
  endTime: string
}) => Request.get<SingleParam.WaterOverview>('/user/uSelectSingleParamDataStatistic', data)

/**web 单设备水质数据 --单参数指标详细  --异常分布 */
export const uSelectSingleParamExceptionDistribution = (data: {
  devId: string | number
  paramName: string
}) =>
  Request.get<SingleParam.AbnormalDivision>('/user/uSelectSingleParamExceptionDistribution', data)

/**web 单设备水质数据 --单参数指标详细  --单参历史记录 */
export const uSelectCheckDataByQueryVo = (
  data: {
    devId: string | number
    paramName: string
    startTime?: string
    endTime?: string
    paramStatus?: string
  } & Omit<Paging, 'start'>
) => Request.get<PagingResponse<SingleParam.CheckData>>('/platFormSubUser/select/CheckDataByVo', data)

/**导出单参数历史检测数据 */
export const exportCheckData = (data: { devId: number; startTime: string; endTime: string }) => {
  let accessToken = localStorage.getItem('token')
  let platFormSubUserId = localStorage.getItem('platFormSubUserId')
    // , {
    //   headers: {
    //     "accessToken": accessToken,
    //     "platFormSubUserId": platFormSubUserId
    //   }
    // }
  return Request.filePost('/exc/exportCheckData', data)
}



/* 单个参数指标的查询记录类型 */
export const selectParamTypeApi = () => {
  return Request.post("/platFormSubUser/select/paramStatus")
}

